package com.example.demo.controller;

import com.example.demo.aspect.WebLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController

public class HelloController {

    private final static Logger logger = LoggerFactory.getLogger(HelloController.class);

    @GetMapping("/hello/{id}")
    @WebLog(description = "hello 接口")
    public List<Integer> hello(@PathVariable("id") String id) {

        logger.info("log info ...... id ");
        logger.warn("log warn ...... id ");
        logger.error("log error ...... id ");
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(5);
        list.add(6);
        list.add(7);
        return list;
    }
}
